package com.hos.net.req.sms;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.hos.net.req.BaseReq;
import com.hos.net.res.MsgHint;

/**
 * Created by Administrator on 2018/8/24 0024.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class SmsVerifyReq extends BaseReq {
    public String phone;
    //验证码
    public String code;

    //1: 系统注册 2：系统找回密码  3：患者注册验证码 4：患者修改密码
    //5：患者微信账号绑定手机号码
    //6：医生注册发送验证码  7：医生重置密码验证码
    public String type;

    @JsonIgnore
    public String hint;

    // (false 检验失败)
    @JsonIgnore
    public boolean isVerifyParameter() {
        if (phone == null || phone.equals("")) {
            hint = new MsgHint("手机号不能为空").toJson();
            return false;
        }
        if (code == null || code.equals("")) {
            hint = new MsgHint("验证码不能为空").toJson();
            return false;
        }
        if (this.type == null || this.type.equals("")) {
            hint = new MsgHint("验证码类型不能为空").toJson();
            return false;
        }
        /*if (!this.type.equals(type)) {
            hint = new MsgHint("验证码类型错误").toJson();
            return false;
        }*/
        return true;
    }

}
